package com.tengju.support.domain.model.message;


import com.tengju.support.domain.model.user.UserId;

import java.util.List;

public interface MessageRepository {

    void batchSave(List<Message> messageBatchRelations);

    void batchUpdateSendStatusByBatchId(BatchId batchId, SendStatus afterStatus);

    void updateSendStatusByUserIdMessageId(UserId userId, TaskId messageId, SendStatus sendStatus);

    List<Message> getUnSendRecordByMessageId(TaskId messageId);

    /**
     * 获取所有未读消息的数量
     */
    Long getAllUnreadTotal(Long userIdCode,
                           List<Integer> messageTypeList,
                           Integer readStatus,
                           Integer sendStatus);

    /**
     * 获取对应消息类型未读消息数量
     */
    List<AppMessageCentreUnreadCount> getMessageTypeUnreadTotal(Long userIdCode,
                                                                Integer readStatus,
                                                                Integer sendStatus);

    /**
     * 消息中心-首页
     */
    AppMessageCentreDetail getMyMessageTypeDetail(Long userIdCode,
                                                  Integer messageType,
                                                  Integer sendStatus);

    /***
     * 消息中心-列表页
     */
    List<Message> queryMyMessageByPage(Long userId,
                                           Integer messageType,
                                           Integer sendStatus,
                                           int offset,
                                           int limit);

    /**
     * 消息中心-列表页消息数量
     */
    Integer getMyMessageListTotal(Long userId,
                                  Integer messageType,
                                  Integer sendStatus);

    /**
     * 消息未读更新未已读状态
     */
    void updateReadStatus(Long userId,
                          Integer messageType,
                          Integer readStatus,
                          Integer sendStatus);


    int countUnSendByMessageId(TaskId messageId);

}
